function [YMin, YMax] = TimeHisMinMax(FirstChan, LastChan, THStart, THEnd)
% [YMin, YMax] = TimeHisMinMax(FirstChan, LastChan, THStart, THEnd)
% Returns the maximum and minimum Y-Axis values for the channels from
% channel number FirstChan to channel number LastChan during the time
% interval THStart to THEnd.

global Project;

YMax = 0.0;
YMin = 0.0;
for index = FirstChan:LastChan
	if YMax < max(double(Project.Test_Item.Run.Channel(index).Time_His(THStart:THEnd)))
		YMax = max(double(Project.Test_Item.Run.Channel(index).Time_His(THStart:THEnd)));
	end
	if YMin > min(double(Project.Test_Item.Run.Channel(index).Time_His(THStart:THEnd)))
		YMin = min(double(Project.Test_Item.Run.Channel(index).Time_His(THStart:THEnd)));
	end
end

